package com.indusfo.spc.controller;

import com.indusfo.spc.aspect.SystemControllerLog;
import com.indusfo.spc.pojo.MatFlow;
import com.indusfo.spc.pojo.RepairDetail;
import com.indusfo.spc.service.RepairDetailService;
import com.indusfo.spc.vo.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/service/repairDetail")
public class RepairDetailController {

    @Autowired
    private RepairDetailService repairDetailService;

    /**
     * 查询
     *
     * @param
     * @return com.indusfo.spc.vo.JSONObject
     */
    @RequestMapping(value = "/queryRepairDetail")
    @SystemControllerLog(description = "查询维修子工序")
    @ResponseBody
    public JSONObject queryRepairDetail(RepairDetail repairDetail) {

        JSONObject json = repairDetailService.selectAll(repairDetail);
        return json;

    }


//    /**
//     * 修改维修子工序
//     *
//     * @param RepairDetail
//     * @return
//     */
//    @RequestMapping(value = "/updateRepairDetail",method= RequestMethod.POST)
//    @SystemControllerLog(description="修改维修子工序")
//    @ResponseBody
//    public JSONObject updateRepairDetail (RepairDetail RepairDetail){
//
//        JSONObject json=RepairDetailService.updateRepairDetail(RepairDetail);
//
//        return json;
//    }


//    /**
//     * 插入
//     *
//     * @return com.indusfo.spc.vo.JSONObject
//     */
//    @RequestMapping(value="/insertRepairDetail", method= RequestMethod.POST)
//    @SystemControllerLog(description="新增维修子工序")
//    @ResponseBody
//    public JSONObject insertRepairDetail(RepairDetail RepairDetail) {
//
//        JSONObject json = RepairDetailService.insertRepairDetail(RepairDetail);
//        return json;
//    }


//    /**
//     * 删除
//     *
//     * @param RepairDetailIds, dataState
//     * @return com.indusfo.spc.vo.JSONObject
//     */
//    @RequestMapping(value="/deleteRepairDetail", method= RequestMethod.POST)
//    @SystemControllerLog(description="删除维修子工序")
//    @ResponseBody
//    public JSONObject delRepairDetail(Long[] RepairDetailIds, Integer dataState) {
//
//        dataState = 2;
//        JSONObject json = RepairDetailService.deleteBldc(RepairDetailIds, dataState);
//        return json;
//    }

    /**
     * 去添加查询（产品，任务单，批次）
     */
    @RequestMapping(value = "/queryListRepairDetailToInsert")
    @ResponseBody
    public JSONObject queryListRepairDetailToInsert(RepairDetail repairDetail) {
        JSONObject json = repairDetailService.queryListRepairDetailToInsert(repairDetail);
        return json;
    }
}
